package net.imwork.amorgemini.service.impl;

import javafx.util.Pair;
import net.imwork.amorgemini.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * Created by lvbr on 2017-07-29 00:12.
 */
@Service
public class EmailServiceImpl implements EmailService {

    @Value("${spring.mail.username}")
    String mailFrom;

    @Autowired
    private JavaMailSender mailSender;

    public void sendSimpleMail(String sendTo, String titel, String content) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom(mailFrom);
        message.setTo(sendTo);
        message.setSubject(titel);
        message.setText(content);
        mailSender.send(message);
    }

    public void sendAttachmentsMail(String sendTo, String titel, String content, List<Pair<String, File>> attachments) {
    }

    public void sendInlineMail() {
    }

    public void sendTemplateMail(String sendTo, String titel, Map<String, Object> content, List<Pair<String, File>> attachments) {
    }
}
